home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / portable / getyx.c < prev    next >
C/C++ Source or Header  |  1993-06-18  |  1KB  |  53 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #undef    getyx
  4.  
  5. #ifdef PDCDEBUG
  6. char *rcsid_getyx = "$Header: C:\CURSES\portable\RCS\getyx.c 2.1 1993/06/18 20:19:59 MH Rel MH $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   getyx()    - get cursor position
  15.  
  16.   X/Open Description:
  17.      The cursor position of the window is placed in the two integer
  18.      variables y and x.  This is implemented as a macro, so no & is
  19.      necessary before the variables.
  20.  
  21.      NOTE: getyx() is a macro.
  22.  
  23.   PDCurses Description:
  24.      This routine is here to as a documentation place holder.  The
  25.      code in this module will never be executed unless you #undef
  26.      getyx(), in which case, you will need the & operator.
  27.  
  28.   X/Open Return Value:
  29.      This function returns OK on success and ERR on error.
  30.  
  31.   X/Open Errors:
  32.      No errors are defined for this function.
  33.  
  34.   Portability:
  35.      PDCurses    int getyx( WINDOW* win, int* y, int* x );
  36.          or         int getyx( WINDOW* win, int y, int x );
  37.      X/Open Dec '88    int getyx( WINDOW* win, int y, int x );
  38.      BSD Curses    int getyx( WINDOW* win, int y, int x );
  39.      SYS V Curses    int getyx( WINDOW* win, int y, int x );
  40.  
  41. **man-end**********************************************************************/
  42.  
  43. int    getyx( WINDOW *win, int *y, int *x )
  44. {
  45. #ifdef PDCDEBUG
  46.     if (trace_on) PDC_debug("getyx() - called\n");
  47. #endif
  48.  
  49.     *y = win->_cury;
  50.     *x = win->_curx;
  51.     return( OK );
  52. }
  53.